import React, { Component, PropTypes } from 'react';
import { Link } from "react-router";
import Module from '../../lib/module';

import { Button, Row, Col, Input, Slider, Breadcrumb } from 'antd';

import {store} from '../../../index';

import AllCar from "../allCar/";
import CarDataCard from "../carDataCard/";
import IDCard from "../idCard/";
import CarWorkingData from "../carWorkingData/";

class Home extends Module {
    constructor(props, context) {
        super(props, context);
        this.state = {
            carClick:null
        };
    }

    componentDidMount() {
    }
    onCarChange(text1){
        this.setState({
            carClick:text1
        })
    }

    render() {
        let {  } = this.state;
        return <div className="N_home">
            <AllCar carClick={(text1)=>{this.onCarChange(text1)}}/>
            <div style={{display:"flex"}}>
                <div>
                    <div className="home-word">
                        车辆数据：
                        <CarDataCard/>
                    </div>
                    <div className="home-word">
                        驾驶会员：
                        <br/>
                        <IDCard></IDCard>
                    </div>
                </div>
                <div className="home-word">
                    车辆运行数据：
                    <CarWorkingData changeCar={this.state.carClick}/>
                </div>
            </div>
        </div>
    }
}

export default Home;
